package cn.action;

import cn.entity.master.Fighter;

import java.awt.event.KeyEvent;

public class FighterMoveAction {


    public void move(int key){

            switch (key) {
                case KeyEvent.VK_W:
                    Fighter.UP = true;
                    break;
                case KeyEvent.VK_A:
                    Fighter.LEFT = true;
                    break;
                case KeyEvent.VK_S:
                    Fighter.DOWN = true;
                    break;
                case KeyEvent.VK_D:
                    Fighter.RIGHT = true;
                    break;
            }
    }
    public void stop(int key){
        switch (key) {
            case KeyEvent.VK_W:
                Fighter.UP = false;
                break;
            case KeyEvent.VK_A:
                Fighter.LEFT = false;
                break;
            case KeyEvent.VK_S:
                Fighter.DOWN= false;
                break;
            case KeyEvent.VK_D:
                Fighter.RIGHT = false;
                break;
        }
    }
}
